package com.crl.module.commands.events
{
	
	import com.crl.module.commands.history.IHistoryCommand;
	
	import flash.events.Event;
	
	
	
	/**
	 *  主要给历史记录的命令;
	 * @author crl
	 * 
	 */	
	public class CommandEvent extends Event
	{
		public static const EMPTY_REDO_BUFFER:String = "emptyRedoBuffer";
		public static const EMPTY_UNDO_BUFFER:String = "emptyUndoBuffer";
		public static const REDO:String = "redo";
		public static const UNDO:String = "undo";
		
		public function CommandEvent(type:String, commandInstance:IHistoryCommand, bubbles:Boolean=false, cancelable:Boolean=false) {
			super(type, bubbles, cancelable);
			_commandInstance = commandInstance;
		}
		
		override public function clone():Event {
			return new CommandEvent(type, commandInstance, bubbles, cancelable);
		}
		

		private var _commandInstance:IHistoryCommand;
		
		public function get commandInstance():IHistoryCommand {
			return _commandInstance;
		}
	}
	
}